﻿using System;

namespace ForSummator
{
    class Program
    {
        static void Main(string[] args)
        {
            // Program 1

            long sum = 0;

            for(int i = 1; i <= 1000000; i++)
            {
                sum += i;
            }

            Console.WriteLine("sum = " + sum);

            // End Program 1

            // Program 2

            Console.WriteLine("How many numbers you want to add?");
            Console.Write("n = ");
            int n = int.Parse(Console.ReadLine());
            long s = 0;

            for(int i = 0; i < n; i++)
            {
                s += int.Parse(Console.ReadLine());
            }

            Console.WriteLine("------");
            Console.WriteLine("sum = " + s);

            // End Program 2
            /*
            while (true) { }
            for(;;) { }
            ;
            { }
            */

            Console.ReadKey();
        }
    }
}
